iron-ajax(auto, url='/api/workgroup/exists', handle-as='json',
    on-response='_onHasWorkgroupResponse', on-error='_onHasWorkgroupError', loading='{{pageLoading}}')
iron-ajax(auto, url='/api/dashboard-links', handle-as='json',
    on-response='_onHasDashboardLinksResponse', on-error='_onHasDashboardLinksError', loading='{{pageLoading}}')
iron-ajax#envInfo(auto='[[_shouldFetchEnv]]', url='/api/workgroup/env-info', handle-as='json',
    on-response='_onEnvInfoResponse')
aside#PageLoader(hidden='{{!pageLoading}}')
app-drawer-layout.flex(narrow='{{narrowMode}}',
        force-narrow='[[or(thinView, hideSidebar)]]',
        persistent='[[persistent]]'
        bleed$='[[sidebarBleed]]')
    app-location(route='{{route}}', query-params='{{queryParams}}')
    app-location(route='{{routeHash}}', use-hash-as-path)
    app-route(route='{{route}}', pattern='/:page', data='{{routeData}}',
        tail='{{subRouteData}}')
    app-drawer#MainDrawer(slot='drawer')
        figure.logo
            |!{logo}
        div.flex.scrollable
            a(href$='[[_buildHref("/", queryParams.*)]]', tabindex='-1')
                paper-item.menu-item#home
                    iron-icon(icon='home')
                    | Home

            template(is='dom-repeat', items='[[menuLinks]]')
                template(is='dom-if', if='[[equals(item.type, "section")]]')
                    paper-item.menu-item.section-item(on-click='_toggleMenuSection')
                        iron-icon(icon='[[item.icon]]')
                        | [[item.text]]
                    iron-collapse
                        template(is='dom-repeat', items='[[item.items]]')
                            iframe-link(href$="[[_buildHref(item.link, queryParams.*)]]")
                                paper-item.menu-item.inner-menu-item [[item.text]]
                template(is='dom-if', if='[[!equals(item.type, "section")]]')
                    iframe-link(href$="[[_buildHref(item.link, queryParams.*)]]")
                        paper-item.menu-item
                            iron-icon(icon='[[item.icon]]')
                            | [[item.text]]
            template(is='dom-repeat', items='[[externalLinks]]')
                template(is='dom-if', if='[[item.iframe]]')
                    iframe-link(href$="[[buildHref(item.link, queryParams)]]")
                        paper-item.menu-item
                            iron-icon(icon='[[item.icon]]')
                            | [[item.text]]
                template(is='dom-if', if='[[!item.iframe]]')
                    a(href$="[[item.link]]",tabindex='-1', target="_blank")
                        paper-item.menu-item
                            iron-icon(icon='[[item.icon]]')
                            | [[item.text]]
            template(is='dom-if', if='[[equals(isolationMode, "multi-user")]]')
                aside.divider
                a(href$='[[_buildHref("/manage-users", queryParams.*)]]', tabindex='-1')
                    paper-item.menu-item#contributors Manage Contributors
            aside.divider
            a(href='https://github.com/kubeflow/kubeflow',
                tabindex='-1', target="_blank")
                paper-item.menu-item GitHub
                    iron-icon.external(icon="launch")
            a(href='https://www.kubeflow.org/docs/about/kubeflow/',
                tabindex='-1', target="_blank")
                paper-item.menu-item Documentation
                    iron-icon.external(icon="launch")
        footer.footer
            section.information
                a.privacy(title='Kubeflow Privacy Policy', target='_blank', href='https://policies.google.com/privacy') Privacy
                .bullet
                a.usage(title='Kubeflow Usage Reporting', target='_blank', href='https://www.kubeflow.org/docs/other-guides/usage-reporting/') Usage Reporting
            section.build build version&nbsp;
                span(title="Build: [[buildVersion]] | Dashboard: v[[dashVersion]] | Isolation-Mode: [[isolationMode]]") [[buildVersion]]
    app-header-layout(fullbleed)
        app-header(slot='header', hides, hidden$='[[notFoundInIframe]]')
            app-toolbar
                template(is='dom-if', if='![[persistent]]')
                    aside#Narrow-Slider(hides, hidden$='[[!narrowMode]]')
                        paper-icon-button#Menu(icon='menu', drawer-toggle)
                        figure.Logo
                            |!{logo}
                namespace-selector#NamespaceSelector(
                    query-params='{{queryParams}}', namespaces='[[namespaces]]'
                    selected='{{namespace}}', hides, hidden$='[[hideNamespaces]]'
                    all-namespaces='[[allNamespaces]]')
                footer#User-Badge
                    a(target="_top", href="/logout")
                        iron-icon.icon(icon='kubeflow:logout' title="Logout")
        main#Content
            section#ViewTabs(hidden$='[[hideTabs]]')
                paper-tabs(selected='[[page]]', attr-for-selected='page')
                    paper-tab(page='dashboard', link)
                        a.link(tabindex='-1', href$='[[_buildHref("/", queryParams.*)]]') Dashboard
                    paper-tab(page='activity', link)
                        a.link(tabindex='-1', href$='[[_buildHref("/activity", queryParams.*)]]') Activity
            neon-animated-pages(selected='[[page]]', attr-for-selected='page',
                                entry-animation='fade-in-animation',
                                exit-animation='fade-out-animation')
                neon-animatable(page='dashboard')
                    dashboard-view(namespace='[[queryParams.ns]]',
                        platform-info='[[platformInfo]]', quick-links='[[quickLinks]]', documentation-items='[[documentationItems]]')
                neon-animatable(page='activity')
                    activity-view(namespace='[[queryParams.ns]]')
                neon-animatable(page='manage-users')
                    manage-users-view(user='[[user]]', namespaces='[[namespaces]]', is-cluster-admin='[[isClusterAdmin]]', owned-namespace='[[ownedNamespace]]')
                neon-animatable(page='iframe')
                    iframe-container(namespace='[[namespace]]',
                        src='[[iframeSrc]]', page="{{iframePage}}")
                neon-animatable(page='not_found')
                    not-found-view(path="[[route.path]]")
    iron-media-query(query='(max-width: 900px)', query-matches='{{sidebarBleed}}')
    iron-media-query(query='(max-width: 1270px)', query-matches='{{thinView}}')
paper-toast#welcomeUser(duration=5000) Welcome, [[_extractLdap(user)]]!
paper-toast#ErrorToast(duration=0, opened='[[!empty(errorText)]]', on-click='closeError') [[errorText]]
    paper-icon-button(icon='close')
template(is='dom-if', if='[[registrationFlow]]')
    registration-page(user-details='[[_extractLdap(user)]]' on-flowcomplete='resyncApp')
